<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>js代码压缩成图片</title>
</head>
<body>
	
	<canvas id="canvas"></canvas>
	
	<img id="img"/>
<script src="js/jsToImg.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var str = `
{
	"total":144,
	"footer":[
		{
			"planOutput":31398
		}
	],
	"rows":[
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":139,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-08-01 10:28:32",
			"operator":"张伟",
			"packNum":"4",
			"personNum":8,
			"planOutput":200,
			"planProducDate":"2018-08-01",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"前地板",
			"classes":"B",
			"id":140,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-08-01 10:25:02",
			"operator":"张伟",
			"packNum":"5",
			"personNum":6,
			"planOutput":204,
			"planProducDate":"2018-08-01",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"左前纵梁",
			"classes":"B",
			"id":141,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-08-01 10:25:25",
			"operator":"张伟",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-08-01",
			"productName":"RAIL ASM-F/CMPT SI, LH (B-SEG, CHINA) 前纵梁总成（左）",
			"productNo":"39180611",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"右前纵梁",
			"classes":"B",
			"id":142,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-08-01 10:25:43",
			"operator":"张伟",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-08-01",
			"productName":"RAIL ASM-F/CMPT SI, RH (B-SEG, CHINA) 前纵梁总成（右）",
			"productNo":"39157555",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"左后纵梁",
			"classes":"B",
			"id":143,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-08-01 10:26:06",
			"operator":"张伟",
			"packNum":"6",
			"personNum":5,
			"planOutput":200,
			"planProducDate":"2018-08-01",
			"productName":"RAIL ASM U/B RR SI, LH LWB LROH CHINA (LB) 后纵梁总成（左）",
			"productNo":"39176658",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"右后纵梁",
			"classes":"B",
			"id":144,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-08-01 10:26:22",
			"operator":"张伟",
			"packNum":"6",
			"personNum":5,
			"planOutput":200,
			"planProducDate":"2018-08-01",
			"productName":"RAIL ASM U/B RR SI, RH LWB LROH CHINA (LB) 后纵梁总成（右）",
			"productNo":"39176659",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"前地板",
			"classes":"A",
			"id":133,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-07-03 18:59:13",
			"operator":"张伟",
			"packNum":"5",
			"personNum":6,
			"planOutput":120,
			"planProducDate":"2018-07-04",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":134,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-07-03 19:00:15",
			"operator":"张伟",
			"packNum":"4",
			"personNum":8,
			"planOutput":120,
			"planProducDate":"2018-07-04",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"右前纵梁",
			"classes":"A",
			"id":135,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-07-03 20:56:36",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":120,
			"planProducDate":"2018-07-04",
			"productName":"RAIL ASM-F/CMPT SI, RH (B-SEG, CHINA) 前纵梁总成（右）",
			"productNo":"39157555",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"左前纵梁",
			"classes":"A",
			"id":136,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-07-03 20:58:45",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-07-04",
			"productName":"RAIL ASM-F/CMPT SI, LH (B-SEG, CHINA) 前纵梁总成（左）",
			"productNo":"39180611",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"左后纵梁",
			"classes":"A",
			"id":137,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-07-03 20:59:12",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":120,
			"planProducDate":"2018-07-04",
			"productName":"RAIL ASM U/B RR SI, LH LWB LROH CHINA (LB) 后纵梁总成（左）",
			"productNo":"39176658",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"右后纵梁",
			"classes":"A",
			"id":138,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-07-03 20:59:50",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":120,
			"planProducDate":"2018-07-04",
			"productName":"RAIL ASM U/B RR SI, RH LWB LROH CHINA (LB) 后纵梁总成（右）",
			"productNo":"39176659",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":132,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-07-03 14:11:34",
			"operator":"张伟",
			"packNum":"4",
			"personNum":8,
			"planOutput":200,
			"planProducDate":"2018-07-03",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"前地板",
			"classes":"A",
			"id":130,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-07-02 15:25:38",
			"operator":"zw",
			"packNum":"5",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-07-02",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":131,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-07-02 15:25:56",
			"operator":"zw",
			"packNum":"4",
			"personNum":8,
			"planOutput":200,
			"planProducDate":"2018-07-02",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"前地板",
			"classes":"A",
			"id":124,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-06-28 08:32:19",
			"operator":"zw",
			"packNum":"5",
			"personNum":6,
			"planOutput":400,
			"planProducDate":"2018-06-28",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"左前纵梁",
			"classes":"A",
			"id":125,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-28 08:32:37",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":400,
			"planProducDate":"2018-06-28",
			"productName":"RAIL ASM-F/CMPT SI, LH (B-SEG, CHINA) 前纵梁总成（左）",
			"productNo":"39180611",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"右前纵梁",
			"classes":"A",
			"id":126,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-28 08:32:53",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":400,
			"planProducDate":"2018-06-28",
			"productName":"RAIL ASM-F/CMPT SI, RH (B-SEG, CHINA) 前纵梁总成（右）",
			"productNo":"39157555",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":127,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-06-28 08:33:22",
			"operator":"zw",
			"packNum":"4",
			"personNum":8,
			"planOutput":400,
			"planProducDate":"2018-06-28",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"左后纵梁",
			"classes":"A",
			"id":128,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-06-28 08:33:45",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":400,
			"planProducDate":"2018-06-28",
			"productName":"RAIL ASM U/B RR SI, LH LWB LROH CHINA (LB) 后纵梁总成（左）",
			"productNo":"39176658",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"右后纵梁",
			"classes":"A",
			"id":129,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-06-28 08:34:04",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":400,
			"planProducDate":"2018-06-28",
			"productName":"RAIL ASM U/B RR SI, RH LWB LROH CHINA (LB) 后纵梁总成（右）",
			"productNo":"39176659",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"前地板",
			"classes":"A",
			"id":118,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-06-27 13:36:39",
			"operator":"zw",
			"packNum":"5",
			"personNum":6,
			"planOutput":204,
			"planProducDate":"2018-06-27",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"左前纵梁",
			"classes":"A",
			"id":119,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-27 13:36:55",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-06-27",
			"productName":"RAIL ASM-F/CMPT SI, LH (B-SEG, CHINA) 前纵梁总成（左）",
			"productNo":"39180611",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"右前纵梁",
			"classes":"A",
			"id":120,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-27 13:37:10",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-06-27",
			"productName":"RAIL ASM-F/CMPT SI, RH (B-SEG, CHINA) 前纵梁总成（右）",
			"productNo":"39157555",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":121,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-06-27 13:37:27",
			"operator":"zw",
			"packNum":"4",
			"personNum":8,
			"planOutput":200,
			"planProducDate":"2018-06-27",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"左后纵梁",
			"classes":"A",
			"id":122,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-06-27 13:37:46",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":200,
			"planProducDate":"2018-06-27",
			"productName":"RAIL ASM U/B RR SI, LH LWB LROH CHINA (LB) 后纵梁总成（左）",
			"productNo":"39176658",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"右后纵梁",
			"classes":"A",
			"id":123,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-06-27 13:38:03",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":200,
			"planProducDate":"2018-06-27",
			"productName":"RAIL ASM U/B RR SI, RH LWB LROH CHINA (LB) 后纵梁总成（右）",
			"productNo":"39176659",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"前地板",
			"classes":"A",
			"id":112,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-06-26 15:53:48",
			"operator":"zw",
			"packNum":"5",
			"personNum":6,
			"planOutput":204,
			"planProducDate":"2018-06-26",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"左前纵梁",
			"classes":"A",
			"id":113,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-26 15:54:06",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-06-26",
			"productName":"RAIL ASM-F/CMPT SI, LH (B-SEG, CHINA) 前纵梁总成（左）",
			"productNo":"39180611",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"右前纵梁",
			"classes":"A",
			"id":114,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-26 15:54:24",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":200,
			"planProducDate":"2018-06-26",
			"productName":"RAIL ASM-F/CMPT SI, RH (B-SEG, CHINA) 前纵梁总成（右）",
			"productNo":"39157555",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"后地板",
			"classes":"A",
			"id":115,
			"jph":"60",
			"lineName":"9B后地板",
			"operatingTime":"2018-06-26 15:54:43",
			"operator":"zw",
			"packNum":"4",
			"personNum":8,
			"planOutput":200,
			"planProducDate":"2018-06-26",
			"productName":"PANEL ASM-R/CMPT, LWB (LB) 后地板总成",
			"productNo":"39176660",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"左后纵梁",
			"classes":"A",
			"id":116,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-06-26 15:55:09",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":200,
			"planProducDate":"2018-06-26",
			"productName":"RAIL ASM U/B RR SI, LH LWB LROH CHINA (LB) 后纵梁总成（左）",
			"productNo":"39176658",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"右后纵梁",
			"classes":"A",
			"id":117,
			"jph":"60",
			"lineName":"9B后纵梁",
			"operatingTime":"2018-06-26 15:55:25",
			"operator":"zw",
			"packNum":"6",
			"personNum":5,
			"planOutput":200,
			"planProducDate":"2018-06-26",
			"productName":"RAIL ASM U/B RR SI, RH LWB LROH CHINA (LB) 后纵梁总成（右）",
			"productNo":"39176659",
			"spareField1":"9BLB",
			"workHour":"8"
		},
		{
			"assemblyName":"前地板",
			"classes":"A",
			"id":106,
			"jph":"60",
			"lineName":"9B前地板",
			"operatingTime":"2018-06-25 09:21:53",
			"operator":"zw",
			"packNum":"5",
			"personNum":6,
			"planOutput":402,
			"planProducDate":"2018-06-25",
			"productName":"PANEL ASM-F/FLR (CHINA) 前地板总成",
			"productNo":"39177185",
			"spareField1":"9BLB",
			"workHour":"11"
		},
		{
			"assemblyName":"左前纵梁",
			"classes":"A",
			"id":107,
			"jph":"45",
			"lineName":"9BLB前纵梁",
			"operatingTime":"2018-06-25 09:22:10",
			"operator":"zw",
			"packNum":"8",
			"personNum":6,
			"planOutput":400,
			"planProducDate":"2018-06-25",
			"productName":"RAIL ASM-F/CMPT SI, LH (B-SEG, CHINA) 前纵梁总成（左）",
			"productNo":"39180611",
			"spareField1":"9BLB",
			"workHour":"11"
		}
	]
}
` ;


jsToImg(encodeURI(str),document.querySelector('canvas'),document.querySelector('img'));
c2img(document.querySelector('canvas'),document.querySelector('img'));
</script>
</body>
</html>